gl renderer: return empty texture for too small blurred nodes
authorTimm Bäder <mail@baedert.org>
Sat, 10 Oct 2020 17:39:33 +0000 (19:39 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 14 Oct 2020 19:06:12 +0000 (15:06 -0400)
gsk/gl/gskglrenderer.c

index ae64a0f76b1b1793da7b57691ceaf2119b49dd2e..58943ab44bc62225ea5ee48bb34eddcc746f2eb1 100644 (file)
@@ -1798,10 +1798,15 @@ blur_texture (GskGLRenderer       *self,
   g_assert (blur_radius > 0);
 
   gsk_gl_driver_create_render_target (self->gl_driver,
-                                      texture_to_blur_width, texture_to_blur_height,
+                                      MAX (texture_to_blur_width, 1), MAX (texture_to_blur_height, 1),
                                       GL_NEAREST, GL_NEAREST,
                                       &pass1_texture_id, &pass1_render_target);
 
+  if (texture_to_blur_width <= 0 || texture_to_blur_height <= 0)
+    {
+      return pass1_texture_id;
+    }
+
   gsk_gl_driver_create_render_target (self->gl_driver,
                                       texture_to_blur_width, texture_to_blur_height,
                                       GL_NEAREST, GL_NEAREST,